import {createBrowserRouter,} from "react-router-dom";
import ErrorPage from "../error-page";
import Moneybox from "../page/Moneybox";
import Contact from "../page/Contact";
import {Message,Todo,PersonalCenter}from "../page/Root/root";
import Test from "../page/test"
import Me from "../page/Me/index";
import Root from "../page/Root/root";
import Book from "../page/Book";
import Formtest from "../page/form";
import Login from "../page/Login";
import Register from "../page/Register/index.jsx";
import { AuthRoute } from "../components/AuthRoute.jsx";
import Three from "../page/Three";
const router = createBrowserRouter([
  {
    path: "/",
    element: <AuthRoute><Root /></AuthRoute>,
    errorElement: <ErrorPage />,
    children: [
      {
        path: "/",
        element: <Moneybox />,
      },
      {
        path: "/book",
        element: <Book />,
      },
      {
        path: "/todo",
        element: <Test />,
      },
      {
        path: "/personalCenter",
        element: <Me />,
      }
    ],
  },
  {
    path: "/form",
    element: <Formtest />,
    errorElement: <ErrorPage />,
    
  },
  {
    path: "/login",
    element: <Login />,
    errorElement: <ErrorPage />,
    
  },
  {
    path: "/register",
    element: <Register />,
    errorElement: <ErrorPage />,
    
  },
  {
    path: "/three",
    element: <Three />,
    errorElement: <ErrorPage />,
    
  },
]);
export default router;